package com.ttg.utils;

//~--- non-JDK imports --------------------------------------------------------

import com.ttg.contants.KeyContants;
import com.ttg.utils.connection.HttpClientUtils;

import java.util.Map;

//~--- JDK imports ------------------------------------------------------------

//~--- classes ----------------------------------------------------------------

/**
 * Class HttpKit
 * Description
 * Create 2016-07-20 10:56:40
 * @author Ardy
 */
public class HttpKit {

    /**
     * Method httpParam2SignStr
     * Description 说明：
     *
     * @param param 说明：
     * @param filterSign 说明：
     * @param filterSignType 说明：
     *
     * @return 返回值说明：
     */
    public static String httpParam2SignStr(Map<String, String> param, String filterSign, String filterSignType) {
        return HttpClientUtils.createLinkString(HttpClientUtils.paramFilter(param, filterSign, filterSignType));
    }

    /**
     * Method httpGwParam2SignStr
     * Description 说明：
     *
     * @param param 说明：
     *
     * @return 返回值说明：
     */
    public static String httpGwParam2SignStr(Map<String, String> param) {
        return httpParam2SignStr(param, KeyContants.SIGNATURE_ALGORITHM, KeyContants.SIGNATURE_INFO);
    }

    /**
     * Method httpWeixinParam2SignStr
     * Description 说明：
     *
     * @param param 说明：
     *
     * @return 返回值说明：
     */
    public static String httpWeixinParam2SignStr(Map<String, String> param) {
        return httpParam2SignStr(param, KeyContants.SIGN, null);
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
